Skip to content

nmc(pe-item3): host-level dual-path won-aux broadcaster regression lock - #451

Merged
frstrtr merged 1 commit into
masterfrom
nmc/pe-item3-host-dualpath-lock
Jun 25, 2026
Merged

nmc(pe-item3): host-level dual-path won-aux broadcaster regression lock#451
frstrtr merged 1 commit into
masterfrom
nmc/pe-item3-host-dualpath-lock

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

Host-level dual-path regression LOCK for NMC PE item 3 — net-new vs the helper-level nmc_block_broadcast_test (which hands raw sinks to the dispatcher and only checks sink presence).

This test reconstructs the actual NMC run-loop binding exactly as src/c2pool/c2pool_refactored.cpp wires it, then locks delivery through both legs with fake sinks:

  • PRIMARY (P2P): backend->set_block_relay([merged_broadcasters, chain_id]{...}) -> merged_broadcasters[chain_id]->submit_block_raw(bytes) (host site ~c2pool_refactored.cpp:5276; returns relayed peer count)
  • FALLBACK (RPC): mm_manager->set_fallback_backend(chain_id, AuxChainRPC) -> AuxChainRPC::submit_aux_block(hash_hex, auxpow_hex) (host site ~:5290 / merged_mining.cpp:454)

Acceptance mapping

  1. Both legs bound on the won-aux pathBindsBothLegsAndDeliversToBothNetworks asserts both networks are actually reached and each leg gets the exact payload.
  2. Regression LOCK (fails if EITHER leg is unbound)host_dual_path_delivered() checks delivery, not presence:
    • DropP2pRelayBindingIsCaught (set_block_relay deleted)
    • DropFallbackBindingIsCaught (set_fallback_backend deleted)
    • MiskeyedChainIdSilentlyDropsP2pButLockCatchesIt — the insidious one: p2p_sent stays true (sink present) yet the peer broadcaster is never invoked. A delivery-level invariant the presence-only helper KAT cannot catch.
    • NeitherLegBoundNeverSilentDrops — both dropped -> ERROR scream, any()==false.
  3. build.yml allowlist — added nmc_host_dualpath_test to BOTH --target rows (Linux L84 + ASan L216) and test/CMakeLists.txt (executable + gtest_add_tests). No dgb: conform subsidy to p2pool-dgb-scrypt oracle (COIN=1e6, weeks+1) [COMPAT] #137/ci: build test_dgb_subsidy in both Linux test jobs (fix master-red NOT_BUILT) #143 NOT_BUILT sentinel.

Scope / safety

Test-only, fake sinks, zero consensus surface — no PoW hash, share format, aux commitment, template, or PPLNS math. src/impl/nmc/ isolated; consumes coin/block_broadcast.hpp (core/log.hpp only) — no btc/ or dgb/ symbol. Does not wire the live won-aux trigger or .140 submitauxblock client (item3-live / item4, gated on operator NMC-go).

Verification

5/5 local PASS; target builds + links clean (reconfigured build dir picks it up). Signed, no third-party attribution.

I do not self-merge — over to you for the gh rollup verify + merge tap.

Net-new vs the helper-level nmc_block_broadcast_test (which only checks
sink PRESENCE): reconstruct the NMC run-loop binding exactly as
c2pool_refactored.cpp does -- set_block_relay -> merged_broadcasters
[chain_id] -> submit_block_raw (PRIMARY P2P) and set_fallback_backend ->
AuxChainRPC::submit_aux_block (FALLBACK submitauxblock) -- and lock
DELIVERY through BOTH legs with fake sinks.

host_dual_path_delivered() asserts both networks were ACTUALLY reached,
so a refactor that drops set_block_relay, drops set_fallback_backend, or
mis-keys merged_broadcasters by chain_id turns the lock RED. The mis-key
case is the insidious one: p2p_sent stays true (sink present) yet the
peer broadcaster is never invoked -- a delivery-level invariant the
presence-only helper KAT cannot catch.

Test-only, fake sinks, zero consensus surface (no PoW/share/aux-commit/
template/PPLNS). nmc/ isolated; consumes coin/block_broadcast.hpp only.
Registered in test/CMakeLists.txt AND both build.yml --target allowlist
rows (Linux + ASan) -- no #137/#143 NOT_BUILT sentinel.

5/5 local PASS.
@frstrtr
frstrtr force-pushed the nmc/pe-item3-host-dualpath-lock branch from 009a3dd to 15915c0 Compare June 25, 2026 13:04
@frstrtr
frstrtr merged commit 069fdaf into master Jun 25, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant